home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_lockerraft.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  164 lines

  1. # Jones 3D Cog Script
  2. #
  3. # RIV_LockerRaft.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     startup
  13.     message     activated
  14.  
  15.     thing       player      local
  16.     thing       indy        local
  17.     thing       t_Item      local
  18.     
  19.     thing       door
  20.     thing       offsetCam
  21.     thing       ghost_Thing
  22.     thing       cam1
  23.     thing       camTarg
  24.     thing       ghostPos        # move player to this pos
  25.     thing       walk_Targ       # walk indy to this pos
  26.     
  27.     template    tpl_Thing=limpraftmove      local
  28.     template    tpl_Actor=indy_actor        local
  29.     
  30.     sound       snd_Open=fol_lockr_opn.wav        local
  31.     sound       snd_Close=fol_lockr_cls.wav       local
  32.     
  33.     sound       snd_Raft=Rv02j01.wav        local # a raft... so this is..
  34.     
  35.     cog         talkCog     local
  36.     cog         hintCog
  37.     
  38.     flex        openDoor    local
  39.     
  40.     int         open=0      local
  41.     int         playing=0   local
  42.     int         bin_Num=57  local
  43.  
  44. end
  45.  
  46. # ========================================================================================
  47.  
  48. code
  49.  
  50. startup:
  51.  
  52.     player = GetLocalPlayerThing();
  53.     SetThingLight(door, '0.25 0.25 0.25', 0.1, 0.5);
  54.     return;
  55.     
  56. # ========================================================================================
  57.  
  58. activated:
  59.  
  60.     if((GetSenderRef() == door) && (open == 0) && (playing == 0))
  61.     {
  62.         Call openDoor;
  63.     }
  64.     
  65.     return;
  66.     
  67. # ========================================================================================
  68.  
  69. openDoor:
  70.  
  71.     SendMessage(hintCog, user0);
  72.  
  73.     # do cutscene stuff
  74.     MakeMeStop();
  75.     StartCutscene(0);
  76.     
  77.     # put away any weapon
  78.     DeselectWeaponWait(player);
  79.     
  80.     # nudge door
  81.     PlayMode(player, 60, 0);
  82.     Sleep(0.3);
  83.     
  84.     # create item
  85.     t_Item = CreateThing(tpl_Thing, ghost_Thing);
  86.     CaptureThing(t_Item);
  87.     
  88.     Sleep(0.5);
  89.     
  90.     # switch to camera inside locker
  91.     SetCameraFocus(2, cam1);
  92.     SetCameraSecondaryFocus(2, camTarg);
  93.     SetCurrentCamera(2);
  94.     
  95.     # move player away from door
  96.     CopyOrientAndPos(ghostPos, player);
  97.     
  98.     # create indy actor
  99.     indy = CreateThing(tpl_Actor, player);
  100.     CaptureThing(indy);
  101.     
  102.     # outfit indy actor
  103.     CopyPlayerHolsters(player, indy);
  104.     
  105.     # hide player show indy
  106.     SetThingFlags(player, 0x80000);
  107.     ClearThingFlags(indy, 0x80000);
  108.     
  109.     Sleep(0.5);
  110.     
  111.     PlaySoundLocal(snd_Open, 1.0, 0.0, 0x0, 0);
  112.     Rotate(door, -90, 1, 1.0);
  113.     WaitForStop(door);
  114.     
  115.     Sleep(0.5);
  116.     
  117.     # indy walks up to locker
  118.     AISetCutsceneMode(indy);
  119.     AISetMoveSpeed(indy, 1.0);
  120.     AISetLookThing(indy, walk_Targ);
  121.     AISetMoveThing(indy, walk_Targ, 1);
  122.  
  123.     # RT: Swap player back in so lips move...
  124.     CopyOrientAndPos(indy, player);
  125.     SetThingFlags(indy, 0x80000);
  126.     ClearThingFlags(player, 0x80000);
  127.     
  128.     # reach for the item
  129.     PlayMode(player, 60, 0);
  130.     Sleep(0.3);
  131.     DestroyThing(t_Item);
  132.     
  133.     # Call the Pickup Lines cog
  134.     talkCog = GetCogByIndex(0);
  135.     SendMessage(talkCog, 27);
  136.     
  137.     # sleep to wait for talkCog
  138.     Sleep(1.3);
  139.     
  140.     # add item to inventory
  141.     SetInvAvailable(player, bin_Num, 1);
  142.     ChangeInv(player, bin_Num, 1.0);
  143.     JonesInvItemChanged(bin_Num);
  144.         
  145.     # Johnny, tell the player what he's picked up
  146.     PlayVoice(player, snd_Raft, 1.0, 1);
  147.  
  148.     # restore camera
  149.     SetCameraPosition(1, GetThingPos(offsetCam));
  150.     SetCurrentCamera(1);
  151.     
  152.     # return control to player
  153.     ClearActorFlags(player, 0x200000);
  154.     EndCutscene();
  155.     
  156.     playing = 0;
  157.     open = 1;
  158.     
  159.     return;
  160.     
  161. # ========================================================================================
  162.  
  163. end
  164.